//    Copyright (C) Kherty.  All rights reserved.
using System;

namespace OpenLS.Spreadsheet
{
    /// <summary>
    /// Represents a collection of rows in a worksheet.
    /// </summary>
    public class RowCollection : DimensionCollection<Row>
    {
        internal RowCollection(Worksheet worksheet)
            : base(worksheet)
        {

        }

        internal override int MaxIndex
        {
            get { return Worksheet.MaxRowIndex; }
        }

        protected override double DefaultLength
        {
            get { return Worksheet.DefaultRowHeight; }
        }
        internal double GetActualHeight (int rowIndex)
        {
            var t = TryGetItem(rowIndex);
            if (t != null)
                return t.ActualHeight;
            return base.GetLengthAt(rowIndex);

        }
    }
}